package com.twu.biblioteca;

import java.util.ArrayList;

/**
 * Created with IntelliJ IDEA.
 * User: ysotirov
 * Date: 31/01/13
 * Time: 12:54
 * To change this template use File | Settings | File Templates.
 */
public abstract class Option implements IMenu {

    IOInterface ioHandler;
    Biblioteca biblioteca;

    public Option(IOInterface ioHndl, Biblioteca bibl){
        ioHandler = ioHndl;
        biblioteca = bibl;
    }

    @Override
    public void executeOption(int opt) {}

    public int getUserChoice(){
        return ioHandler.getInput();
    }

    @Override
    public boolean validInput(int opt, ArrayList validList){
        if ((opt>0) && (opt<=validList.size())) return true;
        return false;
    }
}
